/*
 * Toedo
 * Copyright (C) 2009-2010 J. Devauchelle and contributors.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 3 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

package org.toedo.model;

public class Note extends BaseNote {
	
	public Note(String title) {
		super(title);
	}

	@Override
	protected Object readResolve() {
		mNeedContentRefresh = true;
		return super.readResolve();
	}
	
	@Override
	protected void addTag(Tag tag) {
		if (!mTagsList.contains(tag)) {			
			mTagsList.add(tag);
			tag.addNote(this);
			updateModificationDate();
		}
	}

	@Override
	protected void removeTag(Tag tag) {
		if (mTagsList.contains(tag)) {			
			mTagsList.remove(tag);			
			tag.removeNote(this);
			updateModificationDate();
		}
	}

}
